import request from '@/util/request'

export function follow(id) {
  return request({
    url: `/relationship/subscribe/${id}`,
    method: 'get',
  })
}

export function unFollow(id) {
  return request({
    url: `/relationship/unsubscribe/${id}`,
    method: 'get',
  })
}

export function hasFollow(topicUserId) {
  return request({
    url: `/relationship/validate/${topicUserId}`,
    method: 'get',
  })
}

export function getFollowByName(username, page, size) {
  return request({
    url: '/relationship/follow/' + username,
    method: 'get',
    params: {
      pageNo: page,
      size: size,
    },
  })
}

export function getFanByName(username, page, size) {
  return request({
    url: '/relationship/fan/' + username,
    method: 'get',
    params: {
      pageNo: page,
      size: size,
    },
  })
}
